import java.util.*;

public class demo03 {
    //砝码称重
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        HashSet<Integer> set = new HashSet<>();
        set.add(0);
        for (int i = 0; i < n; i++) {
            List<Integer> list = new ArrayList<>(set);
            for (int k : list) {
                set.add(k + arr[i]);
                set.add(Math.abs(k - arr[i]));
            }
        }
        set.remove(0);
        System.out.println(set.size());
    }
}
